//
//  JMViewController.m
//  CSCommonLib
//
//  Created by Cansing on 11/22/2024.
//  Copyright (c) 2024 Cansing. All rights reserved.
//

#import "JMViewController.h"
#import "UIButton+JMBlock.h"
#import "UIButton+JMImagePosition.h"
#import "MBProgressHUD.h"
#import "JMCommonUtils.h"

@interface JMViewController ()

@end

@implementation JMViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    //Do any additional setup after loading the view, typically from a nib.
    self.view.backgroundColor = UIColor.redColor;

    UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
    btn.frame = CGRectMake(100, 100, 100, 100);
    btn.backgroundColor = UIColor.blueColor;
    [self.view addSubview:btn];
    //[btn addTarget:self action:@selector(btnClick) forControlEvents:UIControlEventTouchUpInside];
    [btn handleControlEvent:UIControlEventTouchUpInside withBlock:^{
      [self btnClick];
    }];
    [btn jm_setImagePosition:0 spacing:10];

    [self btnClick];
}

- (void)btnClick {
    NSLog(@"btnClick");

    [JMCommonUtils showAutomicHiddenHudText:@"cansing"];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    //Dispose of any resources that can be recreated.
}

@end
